﻿package manager
{
    import com.sh.game.loader.*;
    import morn.core.handlers.*;
    import morn.core.managers.*;

    public class XMLMcLoader extends Object
    {
        private var _loader:MovieAssets;
        private var _completeFunc:Function;
        private var _curloader:MassLoaderManager;
        private var _url:String;
        private var _args:Array;
        private var _xml:XML;

        public function XMLMcLoader()
        {
            return;
        }// end function

        public function load(param1:String, param2:int, param3:Function, param4:int = 3, param5:Array = null, param6:Boolean = false) : void
        {
            this._args = param5;
            this._completeFunc = param3;
            if (param4 == 3)
            {
                this._curloader = App.leisureMloader;
            }
            else
            {
                this._curloader = App.mloader3;
            }
            this._url = param1;
            this._curloader.loadBYTE(param1, param2, new Handler(this.completeFunc), null, null, param6);
            return;
        }// end function

        private function completeFunc(param1) : void
        {
            this._loader = new MovieAssets();
            this._loader.read(param1, this._completeFunc, this._args);
            return;
        }// end function

        public function dispose() : void
        {
            if (this._curloader && this._url)
            {
                this._curloader.unload(this._url);
            }
            if (this._loader)
            {
                this._loader.dispose();
                this._loader = null;
            }
            this._args = null;
            return;
        }// end function

    }
}
